/* ========== 全局重置 ========== */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial,Helvetica,sans-serif;
}

/* ========== 背景 ========== */
body{
    height:100vh;
    background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
}

/* ========== 漂浮气泡背景 ========== */
.bg-bubble{
    position:absolute;
    border-radius:50%;
    background:rgba(255,255,255,.18);
    pointer-events:none;
    will-change:transform;
}
@keyframes floatUp{
    0%   { transform:translateY(110vh) scale(.6) rotate(0deg); opacity:0; }
    10%  { opacity:.7; }
    90%  { opacity:.7; }
    100% { transform:translateY(-110vh) scale(1.3) rotate(360deg); opacity:0; }
}

/* ========== 主容器 ========== */
.chat-wrapper{
    width:100%;
    max-width:420px;
    height:92vh;
    background:#fff;
    border-radius:10px;
    box-shadow:0 15px 30px rgba(0,0,0,.18);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    position:relative;
    z-index:1;
}

/* ========== 头部 ========== */
.chat-header{
    flex-shrink:0;
    padding:14px 18px;
    background:linear-gradient(to right,#667eea,#764ba2);
    color:#fff;
    font-size:16px;
    font-weight:bold;
}

/* ========== 消息区 ========== */
.chat-body{
    flex:1;
    padding:12px 14px;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.bubble{
    max-width:75%;
    padding:10px 14px;
    border-radius:12px;
    font-size:14px;
    line-height:1.45;
    word-break:break-word;
    animation:pop .25s backwards;
}
@keyframes pop{from{transform:scale(.94);opacity:0}}
.bubble.me{
    align-self:flex-end;
    background:linear-gradient(135deg,#667eea,#764ba2);
    color:#fff;
    border-bottom-right-radius:4px;
}
.bubble.other{
    align-self:flex-start;
    background:#f5f5f7;
    color:#333;
    border:1px solid #e1e1e1;
    border-bottom-left-radius:4px;
}
.bubble.system{
    align-self:center;
    font-size:12px;
    background:rgba(102,126,234,.12);
    color:#5c5c5c;
    padding:6px 12px;
}

/* ========== 输入区 ========== */
.chat-footer{
    flex-shrink:0;
    padding:8px 14px 18px;
    display:flex;
    align-items:center;
    gap:8px;
}
.chat-footer input{
    flex:1;
    padding:11px 46px 11px 18px;
    border:1px solid #ddd;
    border-radius:24px;
    font-size:15px;
    outline:none;
    transition:border-color .3s;
}
.chat-footer input:focus{border-color:#667eea;}
.send-btn{
    position:absolute;
    right:22px;
    width:36px;
    height:36px;
    border:none;
    border-radius:50%;
    background:linear-gradient(to right,#667eea,#764ba2);
    display:grid;
    place-items:center;
    cursor:pointer;
    transition:transform .2s,box-shadow .2s;
}
.send-btn svg{width:18px;height:18px;fill:#fff;}
.send-btn:hover{transform:scale(1.08);}